package com.autocloud.controller;

import com.autocloud.model.Result;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhongwb
 * @version 1.0
 * @description
 * @date 2019/12/8 9:43 下午
 */

@Controller
@RequestMapping(value = "/good")
public class Test {

    /**
     * 测试
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/detail/{id}" ,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    public Result detail(@PathVariable("id") String id) {
        try {
            return Result.ofsuccess(true);
        } catch (Exception e) {
            return Result.oflost(e.getMessage(), 201);
        }
    }
}
